<?php

	

	//srand ((double) microtime( )*1000000);
	//$random_number = rand( );

	$fp = fopen("output.html", 'w') or die("can't open output file");
	
	$text = urldecode( $_GET['text'] );
	//echo($text);
	$text = str_replace("\\", "", $text);
	//echo( $_GET['text'] );
	
	//fwrite($fp, "<!doctype html>\n");
	fwrite($fp, "<html>\n<head></head>\n<body>\n");
	fwrite($fp, $text);
	fwrite($fp, "\n</body>\n</html>\n");
	
	fclose($fp);
	
	exec("tar cvzf output.tar.gz output.html");

	//readfile("output.html");

	//header('Content-type: text/html');	
	header('Location:http://localhost/~aallison/meebo/layoutTool/output.tar.gz');
	
	//http_redirect("output.html");

?>